<?php

/**
 * auth actions.
 *
 * @package    Skajpaj
 * @subpackage auth
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class authActions extends sfActions
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeIndex(sfWebRequest $request)
  {
  }
  
  public function executeCreateAccount(sfWebRequest $request)
  {
      $this->form = new CreateAccountForm();
      if($request->isMethod(sfRequest::POST)) {
          $this->form->bind($request->getParameter($this->form->getName()));
          if($this->form->isValid()) {
              if($obj = $this->form->save()) {
                  $obj->setIsActive(false);
                  $obj->save();
                  $message = $this->getMailer()->compose();
                  $message->setSubject("Subject");
                  $message->setBody($this->getPartial('auth/createAccountEmail', array('token' => '123456')));
                  $message->setFrom('dev.mediacyfrowe@gmail.com');
                  $message->setTo($obj->getEmailAddress());
                  $this->getMailer()->send($message);
              }
          }
      }
  }
  
  public function executeConfirmRegistration(sfWebRequest $request)
  {
  }
  
}
